<template>
    <div class="footer">
        <div @click="changeItem('order')" :class="'footer-item ' + (act === 'order' ? 'footer-act' : '')">
            <img class="footer-icon" :src="'/static/img/icon/order' + (act === 'order' ? '-act' : '') + '.png'" />
            订单
        </div>
        <div v-if="showMd || special(channel)" @click="changeItem('store')" :class="'footer-item ' + (act === 'store' ? 'footer-act' : '')">
            <img class="footer-icon" :src="'/static/img/icon/store' + (act === 'store' ? '-act' : '') + '.png'" />
            门店
        </div>
        <div @click="changeItem('center')" :class="'footer-item ' + (act === 'center' ? 'footer-act' : '')">
            <img class="footer-icon" :src="'/static/img/icon/center' + (act === 'center' ? '-act' : '') + '.png'" />
            我的
        </div>
    </div>
</template>
<script>
    export default {
        name:'Footer',
        data(){
            return {
                channel:'',
                showMd:false,
                act:'order'
            }
        },
        components:{},
        created(){
            var info = getLogin();
            if(info != null){
                this.channel = info.channel;
            }
            this.showMd = this.isLevel2();
        },
        methods:{
            changeItem(type){
                var urls = {
                    'order':'/',
                    'store':'/store',
                    'center':'/center'
                }
                this.toPage(urls[type]);
                this.act = type;
            }
        }
    }
</script>
<style scoped>
    .footer{
        width: 100%;display: flex;border-top: 1px solid #EBEEF5;
        position:fixed;left:0;bottom: 0;
        z-index: 1;
        background: #fff;
    }
    .footer .footer-item{
        flex: 1;padding:10px 0 5px 0; text-align: center;
        font-size: 12px;
    }
    .footer .footer-icon{width: 25px;height:25px;display: block;margin: auto;margin-bottom: 5px;}
    .footer .footer-act{
        color:#409EFF;
    }
</style>
